home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #067 (1990-04)(Amiga User Group Deutschland e.V.).adf / Include / DiskFont.i < prev    next >
Text File  |  1989-07-02  |  3KB  |  114 lines

  1. {
  2.     DiskFont.i (of PCQ Pascal)
  3.     Copyright 1990 Patrick Quaid
  4.  
  5.     This file contains most of the definitions you'll need
  6.     to mess around with fonts on the Amiga.  Note that in
  7.     order to use any of the four function listed at the
  8.     bottom of the file, you'll have to open the diskfont.library.
  9.     Since NewFontContents and DisposeFontContents were only
  10.     included as of version 34, you should specify a minimum
  11.     version number of 34 in the OpenLibrary call.
  12. }
  13.  
  14. {$I "Include/Ports.i"}
  15. {$I "Include/Graphics.i"}
  16.  
  17. Var
  18.     DiskFontBase : Address;
  19.  
  20. Const
  21.     MAXFONTPATH    = 256;
  22.  
  23. Type
  24.     FontContents = Record
  25.     fc_FileName    : Array [0..MAXFONTPATH] of Char;
  26.     fc_YSize    : Short;
  27.     fc_Style    : Byte;
  28.     fc_Flags    : Byte;
  29.     end;
  30.     FontContentsPtr = ^FontContents;
  31.  
  32. Const
  33.     FCH_ID    = $0f00;
  34.  
  35. Type
  36.     FontContentsHeader = Record
  37.     fch_FileID    : Short; { FCH_ID }
  38.     fch_NumEntries    : Short;   { the number of FontContents elements }
  39.     fch_FC        : Array [0..1] of FontContents;
  40.         { This array will have fch_NumEntries fields }
  41.     end;
  42.     FontContentsHeaderPtr = ^FontContentsHeader;
  43.  
  44. Const
  45.     DFH_ID    = $0f80;
  46.     MAXFONTNAME    = 32; { font name including ".font\0" }
  47.  
  48. Type
  49.     DiskFontHeader = Record
  50.     { the following 8 bytes are not actually considered a part of the }
  51.     { DiskFontHeader, but immediately preceed it. The NextSegment is  }
  52.     { supplied by the linker/loader, and the ReturnCode is the code   }
  53.     { at the beginning of the font in case someone runs it...          }
  54.     {     dfh_NextSegment    : Address;          { actually a BPTR }
  55.     {     dfh_ReturnCode        : Address;      { MOVEQ #0,D0 : RTS }
  56.     { here then is the official start of the DiskFontHeader...          }
  57.     dfh_DF        : Node;   { node to link disk fonts }
  58.     dfh_FileID    : Short;    { DFH_ID }
  59.     dfh_Revision    : Short;    { the font revision }
  60.     dfh_Segment    : Address;    { the segment address when loaded }
  61.     dfh_Name    : Array [0..MAXFONTNAME] of Char;
  62.              { the font name (null terminated) }
  63.     dfh_TF        : TextFont;    { loaded TextFont structure }
  64.     end;
  65.     DiskFontHeaderPtr = ^DiskFontHeader;
  66.  
  67. Const
  68.     AFB_MEMORY    = 0;
  69.     AFF_MEMORY    = 1;
  70.     AFB_DISK    = 1;
  71.     AFF_DISK    = 2;
  72.  
  73.     FPF_ROMFONT        = $0001;
  74.     FPF_DISKFONT     = $0002;
  75.     FPF_REVPATH        = $0004;
  76.     FPF_TALLDOT        = $0008;
  77.     FPF_LONGDOT        = $0010;
  78.     FPF_PROPORTIONAL    = $0020;
  79.     FPF_DESIGNED    = $0040;
  80.     FPF_REMOVED        = $0080;
  81.  
  82. Type
  83.  
  84.     { This structure is called AvailFonts in the C includes,
  85.       but had to be renamed here because of the name conflict }
  86.  
  87.     AvailFont = Record
  88.     af_Type    : Short;    { MEMORY or DISK }
  89.     af_Attr    : TextAttr; { text attributes for font }
  90.     end;
  91.     AvailFontPtr = ^AvailFont;
  92.  
  93.     AvailFontsHeader = Record
  94.     afh_NumEntries    : Short;    { number of AvailFonts elements }
  95.     afh_AF        : Array [0..1] of AvailFont;
  96.             { This array actually has afh_NumEntries elements }
  97.     end;
  98.     AvailFontsHeaderPtr = ^AvailFontsHeader;
  99.  
  100. Function AvailFonts(buffer : Address;
  101.             bufBytes : Integer; types : Integer) : Integer;
  102.     External;
  103.  
  104. Procedure DisposeFontContents(FCH : FontContentsHeaderPtr);
  105.     External; { version 34 }
  106.  
  107. Function NewFontContents(fontsLock : Address { Lock };
  108.             fontName : String) : FontContentsHeaderPtr;
  109.     External; { version 34 }
  110.  
  111. Function OpenDiskFont(TA : TextAttrPtr) : TextFontPtr;
  112.     External;
  113.  
  114.